package com.zhuyuan.security.service;

import com.zhuyuan.system.api.domain.UserInfo;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import java.util.*;

/**
 * @description: 用户信息类，此类本应实现UserDetails接口，但继承User方便
 * @author: 张琳凯
 * @date: 2025/1/23 23:17
 **/
public class UserDetailsImpl extends User {
    //用户id
    private Long userId;
    //用户信息
    private UserInfo userInfo;



    public UserDetailsImpl(Long userId,UserInfo userInfo,String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.userId = userId;
        this.userInfo = userInfo;
    }

    public Long getUserId() {
        return userId;
    }

    public UserInfo getUserInfo() {
        return userInfo;
    }

}

